package com.unionpay.mpds.model;

// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * Factory entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_FACTORY")
public class Factory implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -3586947751503648617L;
	private String factoryId;
	private String factoryName;
	private String factoryType;
	private String factorySize;
	private String factoryStatus;
	private String factoryAddress;
	private String factoryWeb;
	private String factoryTel;
	private String factoryManager;
	private String factoryZip;

	// Constructors

	/** default constructor */
	public Factory() {
	}

	/** minimal constructor */
	public Factory(String factoryId, String factoryName, String factoryType,
			String factorySize, String factoryStatus) {
		this.factoryId = factoryId;
		this.factoryName = factoryName;
		this.factoryType = factoryType;
		this.factorySize = factorySize;
		this.factoryStatus = factoryStatus;
	}

	/** full constructor */
	public Factory(String factoryId, String factoryName, String factoryType,
			String factorySize, String factoryStatus, String factoryAddress,
			String factoryWeb, String factoryTel, String factoryManager,
			String factoryZip) {
		this.factoryId = factoryId;
		this.factoryName = factoryName;
		this.factoryType = factoryType;
		this.factorySize = factorySize;
		this.factoryStatus = factoryStatus;
		this.factoryAddress = factoryAddress;
		this.factoryWeb = factoryWeb;
		this.factoryTel = factoryTel;
		this.factoryManager = factoryManager;
		this.factoryZip = factoryZip;
	}

	// Property accessors

	@Id
	@Column(name = "FACTORY_ID", nullable = false, length = 3)
	public String getFactoryId() {
		return this.factoryId;
	}

	public void setFactoryId(String factoryId) {
		this.factoryId = factoryId;
	}

	@Column(name = "FACTORY_NAME", nullable = false, length = 40)
	public String getFactoryName() {
		return this.factoryName;
	}

	public void setFactoryName(String factoryName) {
		this.factoryName = factoryName;
	}

	@Column(name = "FACTORY_TYPE", nullable = false, length = 1)
	public String getFactoryType() {
		return this.factoryType;
	}

	public void setFactoryType(String factoryType) {
		this.factoryType = factoryType;
	}

	@Column(name = "FACTORY_SIZE", nullable = false, length = 1)
	public String getFactorySize() {
		return this.factorySize;
	}

	public void setFactorySize(String factorySize) {
		this.factorySize = factorySize;
	}

	@Column(name = "FACTORY_STATUS", nullable = false, length = 1)
	public String getFactoryStatus() {
		return this.factoryStatus;
	}

	public void setFactoryStatus(String factoryStatus) {
		this.factoryStatus = factoryStatus;
	}

	@Column(name = "FACTORY_ADDRESS", length = 40)
	public String getFactoryAddress() {
		return this.factoryAddress;
	}

	public void setFactoryAddress(String factoryAddress) {
		this.factoryAddress = factoryAddress;
	}

	@Column(name = "FACTORY_WEB", length = 40)
	public String getFactoryWeb() {
		return this.factoryWeb;
	}

	public void setFactoryWeb(String factoryWeb) {
		this.factoryWeb = factoryWeb;
	}

	@Column(name = "FACTORY_TEL", length = 15)
	public String getFactoryTel() {
		return this.factoryTel;
	}

	public void setFactoryTel(String factoryTel) {
		this.factoryTel = factoryTel;
	}

	@Column(name = "FACTORY_MANAGER", length = 20)
	public String getFactoryManager() {
		return this.factoryManager;
	}

	public void setFactoryManager(String factoryManager) {
		this.factoryManager = factoryManager;
	}

	@Column(name = "FACTORY_ZIP", length = 6)
	public String getFactoryZip() {
		return this.factoryZip;
	}

	public void setFactoryZip(String factoryZip) {
		this.factoryZip = factoryZip;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof Factory))
			return false;
		Factory castOther = (Factory) other;

		return ((this.getFactoryId() == castOther.getFactoryId()) || (this
				.getFactoryId() != null && castOther.getFactoryId() != null && this
				.getFactoryId().equals(castOther.getFactoryId())))
				&& ((this.getFactoryName() == castOther.getFactoryName()) || (this
						.getFactoryName() != null
						&& castOther.getFactoryName() != null && this
						.getFactoryName().equals(castOther.getFactoryName())))
				&& ((this.getFactoryType() == castOther.getFactoryType()) || (this
						.getFactoryType() != null
						&& castOther.getFactoryType() != null && this
						.getFactoryType().equals(castOther.getFactoryType())))
				&& ((this.getFactorySize() == castOther.getFactorySize()) || (this
						.getFactorySize() != null
						&& castOther.getFactorySize() != null && this
						.getFactorySize().equals(castOther.getFactorySize())))
				&& ((this.getFactoryStatus() == castOther.getFactoryStatus()) || (this
						.getFactoryStatus() != null
						&& castOther.getFactoryStatus() != null && this
						.getFactoryStatus()
						.equals(castOther.getFactoryStatus())))
				&& ((this.getFactoryAddress() == castOther.getFactoryAddress()) || (this
						.getFactoryAddress() != null
						&& castOther.getFactoryAddress() != null && this
						.getFactoryAddress().equals(
								castOther.getFactoryAddress())))
				&& ((this.getFactoryWeb() == castOther.getFactoryWeb()) || (this
						.getFactoryWeb() != null
						&& castOther.getFactoryWeb() != null && this
						.getFactoryWeb().equals(castOther.getFactoryWeb())))
				&& ((this.getFactoryTel() == castOther.getFactoryTel()) || (this
						.getFactoryTel() != null
						&& castOther.getFactoryTel() != null && this
						.getFactoryTel().equals(castOther.getFactoryTel())))
				&& ((this.getFactoryManager() == castOther.getFactoryManager()) || (this
						.getFactoryManager() != null
						&& castOther.getFactoryManager() != null && this
						.getFactoryManager().equals(
								castOther.getFactoryManager())))
				&& ((this.getFactoryZip() == castOther.getFactoryZip()) || (this
						.getFactoryZip() != null
						&& castOther.getFactoryZip() != null && this
						.getFactoryZip().equals(castOther.getFactoryZip())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getFactoryId() == null ? 0 : this.getFactoryId().hashCode());
		result = 37
				* result
				+ (getFactoryName() == null ? 0 : this.getFactoryName()
						.hashCode());
		result = 37
				* result
				+ (getFactoryType() == null ? 0 : this.getFactoryType()
						.hashCode());
		result = 37
				* result
				+ (getFactorySize() == null ? 0 : this.getFactorySize()
						.hashCode());
		result = 37
				* result
				+ (getFactoryStatus() == null ? 0 : this.getFactoryStatus()
						.hashCode());
		result = 37
				* result
				+ (getFactoryAddress() == null ? 0 : this.getFactoryAddress()
						.hashCode());
		result = 37
				* result
				+ (getFactoryWeb() == null ? 0 : this.getFactoryWeb()
						.hashCode());
		result = 37
				* result
				+ (getFactoryTel() == null ? 0 : this.getFactoryTel()
						.hashCode());
		result = 37
				* result
				+ (getFactoryManager() == null ? 0 : this.getFactoryManager()
						.hashCode());
		result = 37
				* result
				+ (getFactoryZip() == null ? 0 : this.getFactoryZip()
						.hashCode());
		return result;
	}

}